<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>


    <button  onclick="alert('点我干啥')">点我</button>

    <input type="text" onkeydown="keyDown()">
    
    <a href="http://www.baidu.com" onclick="clickHref()">点我跳转</a>




    <script>
        function keyDown(){
            const event = window.event;
            console.log("event",event);
            
        }


        function clickHref (){
            //希望阻止 超链接的 默认行为
            const event = window.event;
            event.preventDefault();


            console.log("超链接被点击");
        }


    </script>
</body>
</html>